package com.jf.thread;

public class MyThread1 extends Thread {
    private MyInfo1 myInfo1;
    private MyInfo2 myInfo2;
    public MyThread1(MyInfo1 info1,MyInfo2 info2){
        myInfo1 = info1;
        myInfo2 = info2;
    }


    @Override
    public void run() {
        synchronized (myInfo1){
            try {
                sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("info1等待结束，准备执行info2");
            myInfo2.show();
        }
    }
}
